# Contributor: Cedric Bellegarde <cedric.bellegarde@adishatz.org>
maintainer="Bart Ribbers <bribbers@disroot.org>"
pkgname=power-profiles-daemon
pkgver=0.23
pkgrel=0
pkgdesc="Makes power profiles handling available over D-Bus"
url="https://gitlab.freedesktop.org/upower/power-profiles-daemon"
arch="all"
license="GPL-3.0-or-later"
depends="
	glib
	py3-gobject3
	"
makedepends="
	glib-dev
	libgudev-dev
	meson
	polkit-dev
	upower-dev
	"
checkdepends="
	py3-dbusmock
	umockdev
	"
source="https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/archive/$pkgver/power-profiles-daemon-$pkgver.tar.gz
	0001-dbus-no-systemd.patch
	"

build() {
	abuild-meson \
		-Db_lto=true \
		-Dsystemdsystemunitdir="" \
		-Dtests="$(want_check && echo true || echo false)" \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
04ab6ca4abf7861dbe78bafb5c3a9a0aae4c73847e897cf5119b71580298670bd548507fc0e121fe89f11e1e5d1b3c1dbd09b2ab127dc40c802724bcc8e56ead  power-profiles-daemon-0.23.tar.gz
62dcec5d54b9014d16ec74448782beee656d4736c24e69c6a2111c92f895ee6869311e4f7e72a679226485374db14274d6e2ad54e62103b29c3301d6840d8891  0001-dbus-no-systemd.patch
"
